Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Philip Chang // iP PR #124

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

philip1304
Copy link

@philip1304 philip1304 commented Sep 13, 2024

plopBot iP // PR

Copy link

@thomasjlalba thomasjlalba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some formatting errors and some coding styles to follow for this course! Good work!

String command = parts[0].toLowerCase();
String details = parts.length > 1 ? parts[1] : "";

switch (command) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For your switch statements, you could follow the following style set by the couse in this link!

}
catch (Exception e) {
}
System.out.println("");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you couild indicate a meaningful message for exceptions thrown?

catch (IllegalArgumentException ex) {
switch (dateString.toLowerCase()) {
case "today":
return now;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do include break statements, and indicate if its an explicit fallthrough

String[] parts = dateTimeString.split(" ", 2);

if (parts.length == 2) {
LocalDate date = parseDateString(parts[0]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be good to refactor parts[0] to indicate what it means

this.taskName = taskName;
this.type = TaskType.TODO;

//this.isDone = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do remove unnecessary lines!

public String getTypeIcon() {
switch (type) {
case TODO:
return "T";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can avoid magic strings and store the strings!

philip1304 and others added 10 commits October 9, 2024 11:56
ip // Final JAR Release
Notes:
- Added abstraction & documentation // Parser.java
- Added abstraction & documentation, fixed errors that would cause the program to exit // PlopBot.java
- Added documentation // Storage.java
- Added documentation, cleaned up code // Task.java
- Added documentation // TaskList.java
- Added documentation // Ui.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants